// 父类
class People{
    constructor(name,age){
        this.name=name
        this.age=age
        this._sex=-1
    }
    get sex(){//属性
        return this._sex
    }
    set sex(value){
        this._sex=value
    }
    // 实例方法
    showName(){
        console.log(this.name);
    }
    // 静态方法
    static getCount(){
        return 5
    }
}
// 静态属性
People.count=100
console.log(People.count);//100
let p1=new People('周子',24)
console.log(p1);
p1.sex="female"
console.log(p1.sex);//male
console.log(People.getCount());//5

// 子类
class Coder extends People{
    constructor(name,age,hight){
        super(name,age)
        this.hight=hight
    }
    showHight(){
        console.log(this.hight);
    }
}
let c1=new Coder('zhouzi',24,180)
console.log(c1);
c1.showHight()//调用本身的方法
c1.showName()//调用继承的父类方法
console.log(Coder.getCount());//5

